<%@ include file="base.jsp" %>
<%@ page isELIgnored ="true" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<html>
<head>
<title>Insert title here</title>
<script type="text/javascript">
	$(document).ready(function() {
		$('#dd').draggable({  
		    handle:'#title1',
		});  
	});
	function onDrag(e){
		var d = e.data;
		if (d.left < 0){d.left = 0}
		if (d.top < 0){d.top = 0}
		if (d.left + $(d.target).outerWidth() > $(d.parent).width()){
			d.left = $(d.parent).width() - $(d.target).outerWidth();
		}
		if (d.top + $(d.target).outerHeight() > $(d.parent).height()){
			d.top = $(d.parent).height() - $(d.target).outerHeight();
		}
	}
</script>
</head>
<body>
	<include src="base.jsp"/>
	<h2>Basic Draggable</h2>
	<div class="demo-info">
		<div class="demo-tip icon-tip"></div>
		<div>Move the boxes below by clicking on it with mouse.</div>
	</div>
	<div style="margin:10px 0;"></div>
	<div class="easyui-draggable" style="width:200px;height:150px;background:#fafafa;border:1px solid #ccc"></div>
	<div class="easyui-draggable" data-options="handle:'#title'" style="width:200px;height:150px;background:#fafafa;border:1px solid #ccc;margin-left:250px">
		<div id="title" style="padding:5px;background:#ccc;color:#fff">Title</div>
	</div>
	<div id="dd" style="width:100px;height:100px;background:#ccc;">
		<div id="title1" style="background:#ccc;">title</div>
	</div>
		<div style="position:relative;overflow:hidden;border:1px solid #ccc;width:500px;height:300px">
		<div class="easyui-draggable" data-options="onDrag:onDrag" style="width:100px;height:100px;background:#fafafa;border:1px solid #ccc;">
		</div>
	</div>
</body>
</html>